package com.zhaishuaishuai.serviceProvider.controller;

import org.apache.http.HttpRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller("ServiceProviderController")
public class ServiceProviderController {

    @RequestMapping("/sayHello")
    @ResponseBody
    public String sayHello(HttpServletRequest request){
        int port = request.getLocalPort();
        return "sayHello from service-provider"+port;
    }

    @RequestMapping("/useZuul")
    @ResponseBody
    public String useZuul(){
        return "from service provider";
    }

}
